﻿<?php

	define('__ROOT__', dirname(dirname(__FILE__)));
	require_once(__ROOT__.'\models\Conn.php'); 
	require_once(__ROOT__.'\models\Resources.php'); 
	require_once(__ROOT__.'\models\Member.php');
	
	echo "Test.php<br/>";
	
	function downloads(){	
		$dir = "../../Doc/a.pdf";
		if (!file_exists($dir)){
			header("Content-type: text/html; charset=utf-8");
			echo "File not found!";
			exit; 
		} else {
			$file = fopen($dir,"r"); 
			Header("Content-type: application/octet-stream");
			Header("Accept-Ranges: bytes");
			Header("Accept-Length: ".filesize($dir));
			Header("Content-Disposition: attachment; filename=a.pdf");
			echo fread($file, filesize($dir));
			fclose($file);
		}
	}
	downloads();
	
	
?>